package com.ddpt.controller;

import com.ddpt.user.dubbo.DubboUserService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("api/demo")
public class DemoController {
    @DubboReference
    DubboUserService dubboUserService;
    @RequestMapping("test")
    public String test() {
        System.out.println("req");
        return "hello";
    }
    @RequestMapping("testDubbo")
    public Object testDubbo(@RequestParam String word) {
        String sayHello = dubboUserService.sayHello(word);
        System.out.println("request " + word);
        return sayHello;
    }
}
